﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Microsoft.Practices.Unity;
using SISLOG.BusinessEntities;
using SISLOG.BusinessLogic;

namespace SISLOG.Web
{
    public partial class frmRegistrarUsuario : BasePage<frmRegistrarUsuario> //ystem.Web.UI.Page
    {
        [Dependency]
        public IUsuarioBL UsuarioBL { get; set; }

       [Dependency]
        public IAreaBL AreaBL { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
             var opc = Request.QueryString["opc"];

             if (opc != null)
             {
                 if (opc.Equals("editar"))
                 {
                     fvRegistrarUSuario.ChangeMode(FormViewMode.Edit);
                 }
             }
        }


        protected void ObjectDataSourceRegistrarUsuario_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
        {
            e.ObjectInstance = UsuarioBL;
        }

        protected void ObjectDataSourceArea_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
        {
            e.ObjectInstance = AreaBL;
        }
    }
}

/*
  var opc = Request.QueryString["opc"];

             if (opc != null)
             {
                 if (opc.Equals("nuevo"))
                 {
                     fvRegistrarUSuario.ChangeMode(FormViewMode.Insert);
                 }

                 else if (opc.Equals("editar"))
                 {
                     fvRegistrarUSuario.ChangeMode(FormViewMode.Edit);
                 }
             }
 
 */